package com.usabb.utils;


import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;

public final class UploadFileNameUtils {

    public static String getFileName(String originalName, String prefix) {
        if (StringUtils.isEmpty(originalName)) {
            originalName = StringUtils.EMPTY;
        } else {
            originalName = prefix
                    + "-"
                    + System.currentTimeMillis()
                    + RandomStringUtils.randomAlphabetic(3)
                    + originalName.substring(originalName.indexOf("."));
        }

        return originalName;
    }
}
